﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Sahit.iSoilHotel.DistributedServices.MainBoundedContext.InstanceProviders;
using Sahit.iSoilHotel.DistributedServices.MainBoundedContext.Interfaces;
using Sahit.iSoilHotel.Application.MainBoundedContext.DTO.PriceAgg;
using Sahit.iSoilHotel.Application.MainBoundedContext.Tavern.Interfaces;

namespace Sahit.iSoilHotel.DistributedServices.MainBoundedContext
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "TavernPriceService" in code, svc and config file together.
     [UnityInstanceProviderServiceBehavior()]
    public class TavernPriceService : ITavernPriceService
    {
         #region Members

        private readonly IPriceCodeService priceCodeService;
        private readonly IPriceService priceService;

        #endregion

        #region Constructor

        public TavernPriceService(IPriceCodeService priceCodeService
            , IPriceService priceService)
        {
            if (priceCodeService == null)
                throw new ArgumentNullException("PriceCodeService");

            if (priceService == null)
                throw new ArgumentNullException("PriceService");

            this.priceCodeService = priceCodeService;
            this.priceService = priceService;
        }

        #endregion

        public List<PriceCodeDTO> GetAllPriceCodes()
        {
            return priceCodeService.GetAllPriceCodes();
        }


        public PriceDTO GetPrice(Guid roomTypeID)
        {
            return priceService.GetPrice(roomTypeID);
        }
    }
}
